<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<!-- HEADER -->
<nav class="navbar navbar-default" role="navigation">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
        <span class="sr-only">展开菜单</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <!-- 项目标题 -->
      <a class="navbar-brand" href="${ctx}/workbench">极简Bootstrap</a>
    </div>
    <!-- 居左菜单 -->
    <div class="collapse navbar-collapse" id="navbar-collapse">
      <ul class="nav navbar-nav">
        <shiro:hasPermission name="struct-manager">
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">架构管理<span class="caret"></span></a>
          <ul class="dropdown-menu" role=menu>
            <shiro:hasPermission name="departments-list">
            <li><a href="${ctx}/department">部门信息</a></li>
            </shiro:hasPermission>
          </ul>
        </li>
        </shiro:hasPermission>
        <shiro:hasPermission name="projects-manager">
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">项目管理<span class="caret"></span></a>
          <ul class="dropdown-menu" role=menu>
            <shiro:hasPermission name="project-list">
            <li><a href="${ctx}/project">项目信息</a></li>
            </shiro:hasPermission>
            <shiro:hasPermission name="task-list">
            <li><a href="${ctx}/task">任务信息</a></li>
            </shiro:hasPermission>
          </ul>
        </li>
        </shiro:hasPermission>
      </ul>
      <!-- ／居左菜单 -->
      <!-- 居右菜单 -->
      <ul class="nav navbar-nav navbar-right">
        <shiro:hasPermission name="authority-manager">
         <li class="dropdown">
           <a href="#" class="dropdown-toggle" data-toggle="dropdown">权限管理<span class="caret"></span></a>
           <ul class="dropdown-menu" role="menu">
             <shiro:hasPermission name="user-list">
             <li><a href="${ctx}/user">用户信息</a></li>
             </shiro:hasPermission>
             <shiro:hasPermission name="role-list">
             <li><a href="${ctx}/role">角色信息</a></li>
             </shiro:hasPermission>
             <shiro:hasPermission name="sidebar-list">
             <li><a href="${ctx}/sidebar">菜单信息</a></li>
             </shiro:hasPermission>
           </ul>
         </li>
         </shiro:hasPermission>
         <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">
            <img width="18" height="18" src="${ctx}/static/images/avatar/<shiro:principal property="photo"/>" onerror="javascript:this.src='${ctx}/static/images/avatar/all.png';"  alt="<shiro:principal property="name"/>" class="img-rounded">
            <shiro:principal property="name"/>
            <span class="caret"></span>
          </a>
          <ul class="dropdown-menu" role=menu>
            <li><a href="#" data-toggle="modal" data-target="#updatePassword">修改密码</a></li>
            <li class="divider"></li>
            <li><a href="${ctx}/logout">退出登录</a></li>
          </ul>
        </li>
      </ul>
      <!-- ／居右菜单 -->
    </div><!-- / .navbar-collapse -->
  </div><!-- / .container-fluid -->
</nav>
<!--/HEADER -->

<!-- 弹出框 模态框 修改密码 -->
<div class="modal fade" id="updatePassword" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">
          <span aria-hidden="true">&times;</span>
          <span class="sr-only">Close</span>
        </button>
        <h4 class="modal-title" id="myModalLabel"> 修 改 密 码 </h4>
      </div>
      <div class="modal-body">
        <div class="form-group">
	      <label for="project-name">当前密码</label>
	        <input type="password" id="oldPassword" name="oldPassword" class="form-control" placeholder="当前密码"/>
	    </div>
	    <div class="form-group">
	      <label for="project-name" >设置新密码</label>
	        <input type="password" id="newPassword" name="newPassword" class="form-control" placeholder="设置新密码"/>
	    </div>
	    <div class="form-group">
	      <label for="project-name" >重复新密码</label>
	        <input type="password" id="confirmPassword" name="confirmPassword" class="form-control" placeholder="重复新密码"/>
	    </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal"> 取 消 </button>
        <button type="button" class="btn btn-primary" onclick="updatePassword()"> 修 改 </button>
      </div>
    </div>
  </div>
</div>
<!-- /弹出框 模态框 修改密码 -->
